Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Edit Tracking

The EditTracking feature is designed to allow users to keep track of whether an object that contains custom elements or attributes (including unknown elements or attributes) has been edited.

Here's an example of applying this feature. ObjA is created and written out by application AppA, which registers custom attribute type CusAttA. ObjA contains some attributes of type CusAttA. Assume that ObjA is a geometry and attributes of type CusAttA are per-vertex attributes that depend on the overall geometry of the object. Suppose now that ObjA is read by AppB, which does not register attribute type CusAttA. This means that when AppB reads in ObjA, every attribute of type CusAttA is read in as an unknown object. Suppose that AppB edits the geometry of ObjA, resulting in object ObjB. Since AppB doesn't know about attributes of type CusAttA, it cannot edit them so that they conform properly to the edited geometry. This means that in ObjB, geometry and attributes of type CusAttA may be incompatible. To track this possibility, when AppB writes ObjB into a metafile the EditTracking feature will add a special subobject of type edited to ObjB.

Suppose now that the user is back working in AppA and reads in ObjB. AppA recognizes attributes of type CusAttA, so they will be read in as known and will have their effect during rendering. During reading AppA also reads in the edited subobject. This automatically marks object ObjB in such a way that the call Q3Shared_GetEditTrackingState made on ObjB returns 1, signifying that the object contains a custom attribute (or element) which was edited after having been read in. In this case, there is a risk of incorrect rendering. If this condition is not satisfied, Q3Shared_GetEditTrackingState returns 0.

Q3Shared_GetEditTrackingState

You can use the Q3Shared_GetEditTrackingState function to determine if an object contains a custom attribute or element that was edited after having been read in.

unsigned long Q3Shared_GetEditTrackingState(
                     TQ3SharedObject sharedObject);
sharedObject
An object shared by two or more metafiles.

DESCRIPTION

The Q3Shared_GetEditTrackingState function returns 1 if object sharedObject contains a custom attribute or element that was edited after having been read in; otherwise it returns 0.

Q3Shared_ClearEditTracking

You can use the Q3Shared_ClearEditTracking function to clear the marker read by Q3Shared_GetEditTrackingState .

TQ3Status Q3Shared_ClearEditTracking(
                     TQ3SharedObject sharedObject);
sharedObject
An object shared by two or more metafiles.

DESCRIPTION

You can call the Q3Shared_ClearEditTracking function on an object if you wish to guarantee that an edited subobject will not be written to the metafile or that an object that has been read in will return 0 from Q3Shared_GetEditTrackingState .


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |